package mylibrary.network.socket;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.Socket;

public class Client {

	public static void main(String[] args) throws Exception {
		
		Socket socket = new Socket("127.0.0.1", 100);
		
		InputStream in = socket.getInputStream();
		
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		
		int c = 0;
		while((c=in.read()) != -1) {
			bos.write(c);
		}
		
		System.out.println(bos.toString());
	}
}
